package Day07.Demo4;

import javax.swing.*;
import java.util.*;

/**
 * @author chihb
 * @create-time 2024/7/4 13:09
 * @description
 */
public class Test {
    public static void main(String[] args) {
        HashSet<Student> hs=new HashSet<>();
        Scanner sc=new Scanner(System.in);
        while (true){
            System.out.println("请输入用户名：");
            String username=sc.next();
            System.out.println("请输入密码：");
            String userPwd=sc.next();
            Student s=new Student(username,userPwd);
            if(hs.add(s)){
                System.out.println("注册成功...");
                System.out.println("当前的用户有："+ hs);
            }else{
                System.out.println("注册失败...");
            }
        }
    }
}
